//
//  NoteMode.m
//  DogeLegs
//
//  Created by 宋华 on 2017/8/19.
//  Copyright © 2017年 宋华. All rights reserved.
//

#import "NoteMode.h"
#import "ComNoteLIstCell.h"

@implementation NoteMode
+ (NSMutableArray *)noteModeFromData:(NSArray *)dataArr {
    if (![dataArr isKindOfClass:[NSArray class]]) {
        return nil;
    }
    NSMutableArray *notes = [NSMutableArray array];
    for (NSDictionary *dict in dataArr) {
        NoteMode *noteMode = [NoteMode noteModeFromDict:dict];
        [notes addObject:noteMode];
    }
    return notes;
}

+ (NoteMode *)noteModeFromDict:(NSDictionary *)dataDict {
    if (![dataDict isKindOfClass:[NSDictionary class]]) {
        return nil;
    }
    NoteMode *noteMode = [[NoteMode alloc] init];
   //解析方法
    
    

    
    return noteMode;

}

//带💲符号的价格
- (NSString *)doallorPrice {
    if ([_price floatValue] <= 0) {
        return @"";
    }
    return [NSString stringWithFormat:@"$%@",_price];

}

- (NSString *)dicusCountStr {
    return [NSString stringWithFormat:@"Discussion %@",_dicussionCount];
}

// Like 12 类似这种
- (NSString *)likeCountStr {
    return [NSString stringWithFormat:@"Like %@",_likeCount];
}

- (NSString *)noteDateStr {
    return [DateConvert displayDateStr:self.noteDate];
}

- (CGFloat)noteCellHeight {
    if (_noteCellHeight <= 0) {
        _noteCellHeight = [ComNoteLIstCell comNoteCellHeight:self] + 1;
    }
    return _noteCellHeight;
}


@end
